# 计算kitti点云的数量
import os
import struct

file_name = os.getcwd() + r"\..\data\nuscenes_mini_xyzii.bin"
f = open(file_name, "rb")

count = 0
while True:
    x_str = f.read(4)
    if x_str == b'':
        break
    y_str = f.read(4)
    z_str = f.read(4)
    intensity_str = f.read(4)
    # x = struct.unpack('f', x_str)[0]
    # y = struct.unpack('f', y_str)[0]
    # z = struct.unpack('f', z_str)[0]
    # print(x, y, z)

    count += 1

print(count)
f.close()
